function [xnr,ind]=nonrep(x); 
% Given a vector x extract those elements that are not repeated
% consequtively 
% Use for draws of a Random Walk MCMC or any other sticky sampler 
x=x(:); 
t=size(x); 
ind=find( (x(2:end)-x(1:end-1))~=0); 
ind=ind(:); 
ind=[ind;ind(end)+1]; 
xnr=x(ind); 
